#define _CRT_SECURE_NO_WARNINGS 1

bool isValid(char* s)
{
	ST st;
	StackInit(&st);
	while (*s)
	{
		if (*s == '(' || *s == '[' || *s == '{')
		{
			StackPush(&s, *s);
			++s;
		}
		else
		{
			if (StackEmpty(&st))
			{
				return false;
			}
			STDataType top = StackTop(&st);
			StackPop(&st);
			if((*s == '}' && top != '{')
			|| (*s == ']' && top != '[')
			||(*s == '}' && top != '{'))
			{
				StackDestri = oy(&st);
				return false;
			}
			else
			{
				++s;
			}
		}
	}
	bool ret = StackEmpty(&st);
	StackDestory(&st);
	return ret;
}